<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Module      :  Text.XHtml.BlockTable</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- Copyright   :  (c) Andy Gill, and the Oregon Graduate Institute of </span><span>
</span><span id="line-5"></span><span class="hs-comment">--                    Science and Technology, 1999-2001</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Maintainer  :  Chris Dornan &lt;chris@chrisdornan.com&gt;</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Stability   :  Stable</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Portability :  Portable</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- An XHTML combinator library</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- These combinators can be used to build formated 2D tables.</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- The specific target usage is for HTML table generation.</span><span>
</span><span id="line-15"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-comment">{-
   Examples of use:

  	&gt; table1 :: BlockTable String
  	&gt; table1 = single &quot;Hello&quot;	+-----+
					|Hello|
	  This is a 1x1 cell		+-----+
	  Note: single has type
	 
		single :: a -&gt; BlockTable a
	
	  So the cells can contain anything.
	
	&gt; table2 :: BlockTable String
	&gt; table2 = single &quot;World&quot;	+-----+
					|World|
					+-----+


	&gt; table3 :: BlockTable String
	&gt; table3 = table1 %-% table2	+-----%-----+
					|Hello%World|
	 % is used to indicate		+-----%-----+
	 the join edge between
	 the two Tables.  

	&gt; table4 :: BlockTable String
	&gt; table4 = table3 %/% table2	+-----+-----+
					|Hello|World|
	  Notice the padding on the	%%%%%%%%%%%%%
	  smaller (bottom) cell to	|World      |
	  force the table to be a	+-----------+
	  rectangle.

	&gt; table5 :: BlockTable String
	&gt; table5 = table1 %-% table4	+-----%-----+-----+
					|Hello%Hello|World|
	  Notice the padding on the	|     %-----+-----+
	  leftmost cell, again to	|     %World      |
	  force the table to be a	+-----%-----------+
	  rectangle.
 
   Now the table can be rendered with processTable, for example:
	Main&gt; processTable table5
	[[(&quot;Hello&quot;,(1,2)),
	  (&quot;Hello&quot;,(1,1)),
	  (&quot;World&quot;,(1,1))],
	 [(&quot;World&quot;,(2,1))]] :: [[([Char],(Int,Int))]]
	Main&gt; 
-}</span><span>
</span><span id="line-67"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.XHtml.BlockTable</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-68"></span><span>      </span><span class="annot"><span class="hs-comment">-- * Datatypes</span></span><span>
</span><span id="line-69"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier">BlockTable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>      </span><span class="annot"><span class="hs-comment">-- * Contruction Functions</span></span><span>
</span><span id="line-71"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#single"><span class="hs-identifier">single</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#above"><span class="hs-identifier">above</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#beside"><span class="hs-identifier">beside</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>      </span><span class="annot"><span class="hs-comment">-- * Investigation Functions</span></span><span>
</span><span id="line-75"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#getMatrix"><span class="hs-identifier">getMatrix</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#showsTable"><span class="hs-identifier">showsTable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>      </span><span class="annot"><a href="Text.XHtml.BlockTable.html#showTable"><span class="hs-identifier">showTable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>      </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">4</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#beside"><span class="hs-operator hs-type">`beside`</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">3</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#above"><span class="hs-operator hs-type">`above`</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">-- </span><span>
</span><span id="line-86"></span><span class="hs-comment">-- * Construction Functions</span><span>
</span><span id="line-87"></span><span class="hs-comment">--</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- Perhaps one day I'll write the Show instance</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- to show boxes aka the above ascii renditions.</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span id="local-6989586621679036686"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679036637"><span id="local-6989586621679036639"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036686"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036686"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-93"></span><span>      </span><span id="local-6989586621679036634"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; BlockTable a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockTable a -&gt; ShowS
forall a. Show a =&gt; BlockTable a -&gt; ShowS
</span><a href="Text.XHtml.BlockTable.html#showsTable"><span class="hs-identifier hs-var">showsTable</span></a></span></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-keyword">type</span><span> </span><span id="TableI"><span class="annot"><a href="Text.XHtml.BlockTable.html#TableI"><span class="hs-identifier hs-var">TableI</span></a></span></span><span> </span><span id="local-6989586621679036632"><span class="annot"><a href="#local-6989586621679036632"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679036632"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679036632"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">data</span><span> </span><span id="BlockTable"><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-var">BlockTable</span></a></span></span><span> </span><span id="local-6989586621679036681"><span class="annot"><a href="#local-6989586621679036681"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Table"><span class="annot"><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-var">Table</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#TableI"><span class="hs-identifier hs-type">TableI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036681"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-comment">-- | Creates a (1x1) table entry</span><span>
</span><span id="line-101"></span><span id="local-6989586621679036684"><span class="annot"><a href="Text.XHtml.BlockTable.html#single"><span class="hs-identifier hs-type">single</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679036684"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036684"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-102"></span><span id="single"><span class="annot"><span class="annottext">single :: forall a. a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#single"><span class="hs-identifier hs-var hs-var">single</span></a></span></span><span> </span><span id="local-6989586621679036625"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679036625"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; BlockTable a
forall a. (Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-var">Table</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679036624"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036624"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679036623"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036623"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679036622"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036622"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679036625"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036624"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036623"><span class="hs-identifier hs-var">y</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))] -&gt; TableI a
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036622"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-comment">-- | Composes tables vertically.</span><span>
</span><span id="line-106"></span><span id="local-6989586621679036678"><span class="annot"><a href="Text.XHtml.BlockTable.html#above"><span class="hs-identifier hs-type">above</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036678"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036678"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036678"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="hs-comment">-- | Composes tables horizontally.</span><span>
</span><span id="line-109"></span><span id="local-6989586621679036620"><span class="annot"><a href="Text.XHtml.BlockTable.html#beside"><span class="hs-identifier hs-type">beside</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036620"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036620"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036620"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span id="local-6989586621679036619"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036619"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="above"><span class="annot"><span class="annottext">above :: forall a. BlockTable a -&gt; BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#above"><span class="hs-operator hs-var hs-var">`above`</span></a></span></span><span> </span><span id="local-6989586621679036618"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036618"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockTable a -&gt; BlockTable a
forall a. BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#trans"><span class="hs-identifier hs-var">trans</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockTable a
-&gt; BlockTable a
-&gt; (TableI a -&gt; TableI a -&gt; TableI a)
-&gt; BlockTable a
forall a b c.
BlockTable a
-&gt; BlockTable b
-&gt; (TableI a -&gt; TableI b -&gt; TableI c)
-&gt; BlockTable c
</span><a href="Text.XHtml.BlockTable.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockTable a -&gt; BlockTable a
forall a. BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#trans"><span class="hs-identifier hs-var">trans</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036619"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockTable a -&gt; BlockTable a
forall a. BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#trans"><span class="hs-identifier hs-var">trans</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036618"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TableI a -&gt; TableI a -&gt; TableI a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">(.)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span id="local-6989586621679036614"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036614"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="beside"><span class="annot"><span class="annottext">beside :: forall a. BlockTable a -&gt; BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#beside"><span class="hs-operator hs-var hs-var">`beside`</span></a></span></span><span> </span><span id="local-6989586621679036613"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036613"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockTable a
-&gt; BlockTable a
-&gt; (TableI a -&gt; TableI a -&gt; TableI a)
-&gt; BlockTable a
forall a b c.
BlockTable a
-&gt; BlockTable b
-&gt; (TableI a -&gt; TableI b -&gt; TableI c)
-&gt; BlockTable c
</span><a href="Text.XHtml.BlockTable.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036614"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036613"><span class="hs-identifier hs-var">t2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679036612"><span class="annot"><span class="annottext">TableI a
</span><a href="#local-6989586621679036612"><span class="hs-identifier hs-var">lst1</span></a></span></span><span> </span><span id="local-6989586621679036611"><span class="annot"><span class="annottext">TableI a
</span><a href="#local-6989586621679036611"><span class="hs-identifier hs-var">lst2</span></a></span></span><span> </span><span id="local-6989586621679036610"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036610"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-115"></span><span>      </span><span class="hs-comment">-- Note this depends on the fact that</span><span>
</span><span id="line-116"></span><span>      </span><span class="hs-comment">-- that the result has the same number</span><span>
</span><span id="line-117"></span><span>      </span><span class="hs-comment">-- of lines as the y dimention; one list</span><span>
</span><span id="line-118"></span><span>      </span><span class="hs-comment">-- per line. This is not true in general</span><span>
</span><span id="line-119"></span><span>      </span><span class="hs-comment">-- but is always true for these combinators.</span><span>
</span><span id="line-120"></span><span>      </span><span class="hs-comment">-- I should assert this!</span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-comment">-- I should even prove this.</span><span>
</span><span id="line-122"></span><span>      </span><span id="local-6989586621679036609"><span class="annot"><span class="annottext">beside' :: [[(a, (Int, Int))]] -&gt; TableI a
</span><a href="#local-6989586621679036609"><span class="hs-identifier hs-var hs-var">beside'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679036608"><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036608"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679036607"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036607"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679036606"><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036606"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679036605"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036605"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036608"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))] -&gt; [(a, (Int, Int))] -&gt; [(a, (Int, Int))]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036606"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))] -&gt; TableI a
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]] -&gt; TableI a
</span><a href="#local-6989586621679036609"><span class="hs-identifier hs-var">beside'</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036607"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036605"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-123"></span><span>      </span><span class="annot"><a href="#local-6989586621679036609"><span class="hs-identifier hs-var">beside'</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679036604"><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036604"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679036603"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036603"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036604"><span class="hs-identifier hs-var">x</span></a></span><span>        </span><span class="annot"><span class="annottext">[(a, (Int, Int))] -&gt; TableI a
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036603"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]] -&gt; TableI a
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036610"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-124"></span><span>      </span><span class="annot"><a href="#local-6989586621679036609"><span class="hs-identifier hs-var">beside'</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-special">(</span><span id="local-6989586621679036602"><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036602"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679036601"><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036601"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, (Int, Int))]
</span><a href="#local-6989586621679036602"><span class="hs-identifier hs-var">y</span></a></span><span>        </span><span class="annot"><span class="annottext">[(a, (Int, Int))] -&gt; TableI a
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036601"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]] -&gt; TableI a
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036610"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-125"></span><span>      </span><span class="annot"><a href="#local-6989586621679036609"><span class="hs-identifier hs-var">beside'</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span>                  </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]]
</span><a href="#local-6989586621679036610"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-127"></span><span>      </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]] -&gt; TableI a
</span><a href="#local-6989586621679036609"><span class="hs-identifier hs-var">beside'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TableI a
</span><a href="#local-6989586621679036612"><span class="hs-identifier hs-var">lst1</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TableI a
</span><a href="#local-6989586621679036611"><span class="hs-identifier hs-var">lst2</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-comment">-- | trans flips (transposes) over the x and y axis of</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- the table. It is only used internally, and typically</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- in pairs, ie. (flip ... munge ... (un)flip).</span><span>
</span><span id="line-132"></span><span id="local-6989586621679036676"><span class="annot"><a href="Text.XHtml.BlockTable.html#trans"><span class="hs-identifier hs-type">trans</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036676"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036676"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-133"></span><span id="trans"><span class="annot"><span class="annottext">trans :: forall a. BlockTable a -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#trans"><span class="hs-identifier hs-var hs-var">trans</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-type">Table</span></a></span><span> </span><span id="local-6989586621679036600"><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036600"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="local-6989586621679036599"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036599"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span id="local-6989586621679036598"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036598"><span class="hs-identifier hs-var">y1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; BlockTable a
forall a. (Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-var">Table</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; TableI a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036600"><span class="hs-identifier hs-var">f1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036598"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036599"><span class="hs-identifier hs-var">x1</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span id="local-6989586621679036673"><span id="local-6989586621679036674"><span id="local-6989586621679036675"><span class="annot"><a href="Text.XHtml.BlockTable.html#combine"><span class="hs-identifier hs-type">combine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036675"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span>
</span><span id="line-136"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036674"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span>
</span><span id="line-137"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#TableI"><span class="hs-identifier hs-type">TableI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036675"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#TableI"><span class="hs-identifier hs-type">TableI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036674"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#TableI"><span class="hs-identifier hs-type">TableI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036673"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span>
</span><span id="line-138"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036673"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-139"></span><span id="combine"><span class="annot"><span class="annottext">combine :: forall a b c.
BlockTable a
-&gt; BlockTable b
-&gt; (TableI a -&gt; TableI b -&gt; TableI c)
-&gt; BlockTable c
</span><a href="Text.XHtml.BlockTable.html#combine"><span class="hs-identifier hs-var hs-var">combine</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-type">Table</span></a></span><span> </span><span id="local-6989586621679036595"><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036595"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="local-6989586621679036594"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036594"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span id="local-6989586621679036593"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036593"><span class="hs-identifier hs-var">y1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-type">Table</span></a></span><span> </span><span id="local-6989586621679036592"><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI b
</span><a href="#local-6989586621679036592"><span class="hs-identifier hs-var">f2</span></a></span></span><span> </span><span id="local-6989586621679036591"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036591"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span id="local-6989586621679036590"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036590"><span class="hs-identifier hs-var">y2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679036589"><span class="annot"><span class="annottext">TableI a -&gt; TableI b -&gt; TableI c
</span><a href="#local-6989586621679036589"><span class="hs-identifier hs-var">comb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; TableI c) -&gt; Int -&gt; Int -&gt; BlockTable c
forall a. (Int -&gt; Int -&gt; TableI a) -&gt; Int -&gt; Int -&gt; BlockTable a
</span><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-var">Table</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI c
</span><a href="#local-6989586621679036588"><span class="hs-identifier hs-var">new_fn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036594"><span class="hs-identifier hs-var">x1</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036591"><span class="hs-identifier hs-var">x2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036587"><span class="hs-identifier hs-var">max_y</span></a></span><span>
</span><span id="line-140"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-141"></span><span>      </span><span id="local-6989586621679036587"><span class="annot"><span class="annottext">max_y :: Int
</span><a href="#local-6989586621679036587"><span class="hs-identifier hs-var hs-var">max_y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036593"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036590"><span class="hs-identifier hs-var">y2</span></a></span><span>
</span><span id="line-142"></span><span>      </span><span id="local-6989586621679036588"><span class="annot"><span class="annottext">new_fn :: Int -&gt; Int -&gt; TableI c
</span><a href="#local-6989586621679036588"><span class="hs-identifier hs-var hs-var">new_fn</span></a></span></span><span> </span><span id="local-6989586621679036578"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036578"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679036577"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-143"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036593"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036590"><span class="hs-identifier hs-var">y2</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-144"></span><span>          </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TableI a -&gt; TableI b -&gt; TableI c
</span><a href="#local-6989586621679036589"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036595"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI b
</span><a href="#local-6989586621679036592"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036578"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>          </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TableI a -&gt; TableI b -&gt; TableI c
</span><a href="#local-6989586621679036589"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036595"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI b
</span><a href="#local-6989586621679036592"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036578"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036593"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036590"><span class="hs-identifier hs-var">y2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>          </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TableI a -&gt; TableI b -&gt; TableI c
</span><a href="#local-6989586621679036589"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036595"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036590"><span class="hs-identifier hs-var">y2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036593"><span class="hs-identifier hs-var">y1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI b
</span><a href="#local-6989586621679036592"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036578"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679036577"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">-- </span><span>
</span><span id="line-149"></span><span class="hs-comment">-- * Investigation Functions</span><span>
</span><span id="line-150"></span><span class="hs-comment">--</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- | This is the other thing you can do with a Table;</span><span>
</span><span id="line-153"></span><span class="hs-comment">-- turn it into a 2D list, tagged with the (x,y)</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- sizes of each cell in the table.</span><span>
</span><span id="line-155"></span><span id="local-6989586621679036659"><span class="annot"><a href="Text.XHtml.BlockTable.html#getMatrix"><span class="hs-identifier hs-type">getMatrix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036659"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679036659"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">]</span></span><span>
</span><span id="line-156"></span><span id="getMatrix"><span class="annot"><span class="annottext">getMatrix :: forall a. BlockTable a -&gt; [[(a, (Int, Int))]]
</span><a href="Text.XHtml.BlockTable.html#getMatrix"><span class="hs-identifier hs-var hs-var">getMatrix</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.XHtml.BlockTable.html#Table"><span class="hs-identifier hs-type">Table</span></a></span><span> </span><span id="local-6989586621679036575"><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036575"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; TableI a
</span><a href="#local-6989586621679036575"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- You can also look at a table</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span id="local-6989586621679036685"><span class="annot"><a href="Text.XHtml.BlockTable.html#showsTable"><span class="hs-identifier hs-type">showsTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036685"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036685"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#ShowS"><span class="hs-identifier hs-type">ShowS</span></a></span></span><span>
</span><span id="line-161"></span><span id="showsTable"><span class="annot"><span class="annottext">showsTable :: forall a. Show a =&gt; BlockTable a -&gt; ShowS
</span><a href="Text.XHtml.BlockTable.html#showsTable"><span class="hs-identifier hs-var hs-var">showsTable</span></a></span></span><span> </span><span id="local-6989586621679036564"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036564"><span class="hs-identifier hs-var">table</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[(a, (Int, Int))]] -&gt; ShowS
forall a. Show a =&gt; a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#shows"><span class="hs-identifier hs-var">shows</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockTable a -&gt; [[(a, (Int, Int))]]
forall a. BlockTable a -&gt; [[(a, (Int, Int))]]
</span><a href="Text.XHtml.BlockTable.html#getMatrix"><span class="hs-identifier hs-var">getMatrix</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036564"><span class="hs-identifier hs-var">table</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span id="local-6989586621679036562"><span class="annot"><a href="Text.XHtml.BlockTable.html#showTable"><span class="hs-identifier hs-type">showTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036562"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.XHtml.BlockTable.html#BlockTable"><span class="hs-identifier hs-type">BlockTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679036562"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-164"></span><span id="showTable"><span class="annot"><span class="annottext">showTable :: forall a. Show a =&gt; BlockTable a -&gt; String
</span><a href="Text.XHtml.BlockTable.html#showTable"><span class="hs-identifier hs-var hs-var">showTable</span></a></span></span><span> </span><span id="local-6989586621679036559"><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036559"><span class="hs-identifier hs-var">table</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockTable a -&gt; ShowS
forall a. Show a =&gt; BlockTable a -&gt; ShowS
</span><a href="Text.XHtml.BlockTable.html#showsTable"><span class="hs-identifier hs-var">showsTable</span></a></span><span> </span><span class="annot"><span class="annottext">BlockTable a
</span><a href="#local-6989586621679036559"><span class="hs-identifier hs-var">table</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-165"></span></pre></body></html>